/*头部*/
$(function(){
	$(".log_user_info_del").click(function(){
		$(".user_info1").css("display","none").css("");
		$(".user_info2").css("display","none");
	});
	
	$("#myli").mouseover(function(){
		$("#myspan").css("display","block");
		$("#current_userInfo").css("display","block");
	});
	
	
	$("#myli").mouseout(function(){
		$("#myspan").css("display","none");
		$("#current_userInfo").css("display","none");
	});
});

//对于点击修改页面
function Revised(){
	$(".user_info1").css("display","block").css("");
	$(".user_info2").css("display","block");
	
	$(".moodText1").val($("#uname").val());
	$(".moodText3").val($("#intro").val());
}

//用户修改信息
function Detail(){
	$(".user_info1").css("display","none").css("");
	$(".user_info2").css("display","none");
	var id=$("#w_uid").val();
	var MoodText=$(".moodText1").val();
	var MoodPic=$(".moodText2").val();
	var MoodIntro=$(".moodText3").val();
	
	if(checkInfo(MoodText) || checkInfo(MoodIntro)) {
		alert("非法输入!");
	} else {
		$.post("../userServlet?"+new Date(),{op:"updateUserInfo",w_uid:id,uname:MoodText,intro:MoodIntro,upic:MoodPic},function(data){
			data=parseInt($.trim(data));
			if(data ==1) {
				alert("修改成功!");
				window.location='per.jsp';
			}else{
				alert("修改失败!\n请稍后再试!");
			}
		});
	}
	
}

function checkInfo(val){
	var reg=new RegExp("<script>");
	return reg.test(val);
}
